<template>
    <div id="main" class="app-main">
        <router-view />
    </div>
</template>
<script>
export default {
    name: 'app',
    components: {

    },
    mounted: function() {
        let u = navigator.userAgent;
        let flag = !!u.match(/AppleWebKit.*Mobile.*/);

        this.$store.commit("setMobile", flag);

        window.addEventListener('beforeunload', this.handleBeforeUnload);
    },
    beforeDestroy() {
        // 移除事件监听
        window.removeEventListener('beforeunload', this.handleBeforeUnload);
    },
    methods: {
        handleBeforeUnload(event) {
            const message = '您确定要离开此页面吗？';
            event.returnValue = message; // 标准的跨浏览器兼容性处理
            return message; // 为了某些浏览器的兼容性而返回信息
        }
    },
    watch: {
        '$route'(to) {



        }
    }
}
</script>
<style>
html,
body {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    overflow: hidden;
}

.el-tag {
    margin-bottom: 10px;
}

.btline {
    margin-bottom: 10px;
}

.ivu-layout {
    height: 100%;
}

.ivu-table {
    height: auto;
}

.layout-logo {
    background: #17233d;
    color: #fff;
    height: 60px;



    position: relative;
    text-align: center;
    padding: 10px;
}

.layout-nav {
    margin: 0 20px 0 200px;
}

.layout-main {
    padding: 24px;

    background-color: #fff;
    margin: 0px 10px 24px 10px;
}

.layout-main-1 {
    padding: 24px 0px;
    margin-bottom: 24px;
    background-color: #fff;
}

.ivu-layout-footer {
    text-align: left;
    width: 200px;
    position: fixed;
    left: 0px;
    z-index: 9;
    bottom: 0px;

}

.el-button {
    position: relative;
}

.el-button .el-badge {
    position: absolute;
    top: -5px;
    right: -5px;
}

.ivu-btn {
    margin-right: 10px;
}

.ivu-table {
    height: auto;
}

.app-main {
    width: 100%;
    height: 100%;
    overflow: scroll;
}

.tips {
    color: #ff9900;
    font-size: 16px;
}

.tips.success {
    color: #19be6b
}

.tips.error {
    color: #ed4014
}

.tips.info {
    color: #2db7f5
}

.ivu-alert {
    font-size: 14px;
    line-height: 20px;
}

.state-success-full {
    background: #19be6b;

    color: #fff;
    padding: 5px;
}

.state-primary-full {
    background: #2d8cf0;
    padding: 5px;
    color: #fff;
}

.state-warning-full {
    background: #ff9900;

    color: #fff;
    padding: 5px;
}

.state-error-full {
    padding: 5px;
    background: #ed4014;

    color: #fff;
}

.state-info-full {
    background: #2db7f5;
    padding: 5px;

    color: #fff;
}

.state-holder-full {
    color: rgba(0, 0, 0, 0.5);
    background-color: #f7f7f7;
    padding: 5px;
}

.state-default {

    color: #17233d;
}

.state-success {
    color: #67C23A;

}

.state-primary {
    color: #2d8cf0;

}

.state-warning {
    color: #ff9900;

}

.state-error {
    color: #ed4014;

}

.state-info {
    color: #2db7f5;

}



.state-default-border {
    padding: 0px 5px;
    color: #17233d;
    border: 1px solid #17233d;
}

.state-success-border {
    color: #19be6b;
    padding: 0px 5px;
    border: 1px solid #19be6b;

}

.state-primary-border {
    color: #2d8cf0;
    padding: 0px 5px;
    border: 1px solid #2d8cf0;

}

.state-warning-border {
    color: #ff9900;
    padding: 0px 5px;
    border: 1px solid #ff9900;

}

.state-error-border {
    color: #ed4014;
    padding: 0px 5px;
    border: 1px solid #ed4014;

}

.state-info-border {
    color: #2db7f5;
    padding: 0px 5px;
    border: 1px solid #2db7f5;

}

.order-list {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.orderitem {

    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;

    padding: 5px 0px;
    border-bottom: 1px dotted #cecece;
}



.info {
    background: #2db7f5;
}

.success {
    background: #19be6b
}

.warning {
    background: #ff9900
}

.error {
    background: #ed4014
}

.primary {
    background: #2d8cf0
}


.ivu-table .demo-table-error-row td {
    color: #ed4014;

}

.ivu-table .demo-table-warn-row td {
    color: #ff9900;

}

.el-tag {
    cursor: pointer;
    margin-right: 5px;
}

.el-alert {
    margin-bottom: 10px;
}


.cus-footer {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    overflow: hidden;
}

.cus-footer-left {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    width: 1px;
    overflow: hidden;
    text-align: left;

}

.el-tag+.el-tag {
    margin-left: 10px;
}

.button-new-tag {
    margin-left: 10px;
    height: 32px;
    line-height: 30px;
    padding-top: 0;
    padding-bottom: 0;
}

.input-new-tag {
    width: 90px;
    margin-left: 10px;
    vertical-align: bottom;
}


.r-main-board {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.r-main-board__toolbar {
    height: 64px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    background: #fff;
}

.r-main-board__app-container {
    position: relative;
    flex: 1;
    height: calc(100% - 64px);
    height: calc(100% - var(--main-frame-header-height));
}


.r-home__sidebar {
    position: absolute !important;
    top: 0;
    bottom: 0;
    background: #fff;
    width: 172px;
    padding: 10px;
    overflow: scroll;
    -webkit-box-shadow: 1px 0 0 0 #e3e3e3;
    box-shadow: 1px 0 0 0 #e3e3e3;
    -webkit-transition: width .2s ease-in-out;
    transition: width .2s ease-in-out;
}

.r-home__sidebar::-webkit-scrollbar {
    width: 0px;
}

.r-home__sidebar::-webkit-scrollbar-thumb {
    background: #e8eaec;
}

.r-home__sidebar::-webkit-scrollbar-track {
    background-color: transparent;
}


.r-home__sidebar.v1 {
    left: 10px;

    width: 272px;
}

.r-home__sidebar.v2 {
    right: 10px;
    width: 272px;

}


.r-home__sidebar__header {
    height: 130px;
    display: -webkit-box;
    display: -ms-flexbox;
    /*border: 1px solid #cecece;*/
    background: #fff;
    position: absolute;
    top: 0px;

}
.r-home__sidebar__header.v2
{
    height: 150px;
}
.r-home__sidebar__content {

    border: 1px solid #cecece;
    position: absolute;
    top: 140px;
    bottom: 0px;
    overflow: scroll;
    right: 10px;
    left: 10px;


}
.r-home__sidebar__content.v2{
      top: 160px;
}
.r-home__sidebar__header i.create_pm:before {
    display: inline-block;
    line-height: 45px;
    width: 45px;
    text-align: center;
}

.r-home__sidebar__header span.name {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    width: 1px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 16px;
}

.r-home__sidebar-menu {
    height: 40px;
    font-size: 14px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding-left: 8px;
    cursor: pointer;
    position: relative;
    border-radius: 8px;
}



.r-home__content {
    position: absolute;
    left: 293px;
    top: 0;
    right: 293px;
    bottom: 0;
    overflow: hidden;
    -webkit-transition: left .3s ease-in-out;
    transition: left .3s ease-in-out;
    background: #fff;
    overflow: scroll;
    box-shadow: 1px 0 0 0 #e3e3e3;

}

.r-content {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

/*.r-content__header,*/
.r-content__header-right {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.r-content__header {
    /*    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;*/
    height: 45px;
    -webkit-box-shadow: 0 1px 0 0 #e3e3e3;
    box-shadow: 0 1px 0 0 #e3e3e3;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    background: #fff;
    width: 100%;
}

.r-content__header i {
    font-size: 18px;
}

.r-content__header i:before {
    display: inline-block;
    line-height: 45px;
    width: 45px;
    text-align: center;
    cursor: pointer;
}

.r-content__body {
    position: absolute !important;
    top: 45px;
    bottom: 0;
    left: 0;
    right: 0;
}

.r-content__body.v3 {
    top: 0px;
}

.r-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.r-empty__tip {
    margin: 0;
    color: #666;
    line-height: 22px;
    margin-top: 12px;
    text-align: center;
}

::-webkit-scrollbar {
    width: 0;
}

::-webkit-scrollbar-thumb {
    background: #e8eaec;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}
</style>